#ifndef HTTP_GET_H
#define HTTP_GET_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkCookie>

#include "wx_api.h"

class Http_Get : public QObject
{
    Q_OBJECT
public:
    explicit Http_Get(QObject *parent = 0);
    virtual ~Http_Get();

    QList<QNetworkCookie>cookies() const {return m_cookies;}
    void get(QString url, bool needSetCookie = false);

protected:
    virtual void finished(QNetworkReply* reply) {Q_UNUSED(reply);}

private:
    QNetworkAccessManager m_nam;
    QString m_url;
    QList<QNetworkCookie> m_cookies;
    QMetaObject::Connection m_sslErrorConnection;
    QMetaObject::Connection m_finishConnection;
};

#endif // HTTP_GET_H
